package com.chrisandjo.rostra.domain;

import static com.googlecode.instinct.expect.Expect.expect;
import com.googlecode.instinct.integrate.junit4.InstinctRunner;
import com.googlecode.instinct.marker.annotate.Specification;
import org.junit.runner.RunWith;

import java.util.HashSet;
import java.util.Set;

@RunWith(InstinctRunner.class)
public class ATaskWithOnePerson {
    @Specification
    public void mustHaveOnePerson() {
        Task task = new TaskEntity("2008-03-03");
        Set<Person> people = new HashSet<Person>();
        Person person = new PersonEntity("Chris");
        people.add(person);
        task.addPeople(people);

        Set<Person> peopleInTask = task.getPeople();
        expect.that(peopleInTask).isOfSize(1);
        expect.that(peopleInTask).containsItem(person);
    }

}
